from .user import UserModel
from rest_framework import serializers


class UserInfoSerializer(serializers.ModelSerializer):
    ''' 用户信息序列化 '''
    gender = serializers.CharField(source='get_gender_display')
    create_time = serializers.DateTimeField(format='%Y-%m-%d %H:%M:%S')
    update_time = serializers.DateTimeField(format='%Y-%m-%d %H:%M:%S')

    class Meta:
        model = UserModel
        exclude = ['password', 'is_delete']

    